package cn.itcast.tlias.com.tliaswork.aop;


import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@Aspect
public class MyAspect7 {

//    @Pointcut("execution(public void cn.itcast.tlias.com.tliaswork.service.impl.DeptServiceImpl.delete(int))")
//    public void pt(){}



    //@Pointcut("execution(* *(..))")匹配所有慎用
    //@Pointcut("execution( void delete(int))")

    //采用注解的方式声明切入点的表达式
    @Pointcut("@annotation(cn.itcast.tlias.com.tliaswork.aop.MyLog)")
    public void pt(){}

    @Before("pt()")
    public void before(){
        log.info("MyAspect6.....before....");
    }
}
